using System;

using octalforty.BizFramework.Core;

namespace octalforty.Waffle.ObjectModel.Business.Objects
{
    /// <summary>
    /// Represents a single user of octalforty Waffle.
    /// </summary>
    public class User : BusinessObjectBase, IBusinessObjectWithEmailAddress, 
        IBusinessObjectWithVersionTag
    {
        #region Private Member Variables
        private string firstName;
        private string lastName;
        private string emailAddress;
        private string login;
        private long versionTag;
        private DateTime registeredOn = DateTime.Now;
        private byte[] password;
        #endregion

        #region Public Properties
        /// <summary>
        /// Gets or sets a string which contains the first name of this <see cref="User"/>.
        /// </summary>
        public virtual string FirstName
        {
            get { return firstName; }
            set { firstName = value; }
        }
        
        /// <summary>
        /// Gets or sets a string which contains the last name of this <see cref="User"/>.
        /// </summary>
        public virtual string LastName
        {
            get { return lastName; }
            set { lastName = value; }
        }

        /// <summary>
        /// Gets or sets a string which contains the login of this <see cref="User"/>.
        /// </summary>
        public virtual string Login
        {
            get { return login; }
            set { login = value; }
        }

        /// <summary>
        /// Gets or sets a <see cref="DateTime"/> which contains the date and time this
        /// <see cref="User"/> was registered.
        /// </summary>
        public virtual DateTime RegisteredOn
        {
            get { return registeredOn; }
            set { registeredOn = value; }
        }

        /// <summary>
        /// Gets or sets a <see cref="Byte"/> array which contains the hash of the password.
        /// </summary>
        public virtual byte[] Password
        {
            get { return password; }
            set { password = value; }
        }
        #endregion

        /// <summary>
        /// Initializes a new instance of <see cref="User"/> class.
        /// </summary>
        public User()
        {
        }

        #region IBusinessObjectWithEmailAddress Members
        /// <summary>
        /// Gets or sets email address.
        /// </summary>
        public virtual string EmailAddress
        {
            get { return emailAddress; }
            set { emailAddress = value; }
        }
        #endregion

        #region IBusinessObjectWithVersionTag Members
        /// <summary>
        /// Gets or sets business object version tag.
        /// </summary>
        public virtual long VersionTag
        {
            get { return versionTag; }
            set { versionTag = value; }
        }
        #endregion
    }
}
